
//
// 120311 - AH - Created.
// 120313 - AH - Made Serializable.
// 120406a- AH - (Huset) setContent(List<AttributeObject>).
// 120406b- AH - (Huset) No longer abstract, need only one we decided (all can
//               be a sequence she said).
// 120515 - AH - Deprecated.
// 
//

package org.soekrat.server.serialization;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.soekrat.AttributeObject;

/**
 * <p>
 *   Base class for objects that hold a specific type of retrieved data.
 * </p>
 * @author Arne Halvorsen (AH)
 * @author Laetitia Le Chatton (LLC)
 * @deprecated 
 */
@SuppressWarnings("serial")
@Deprecated
public final class ConversationObjectSerializable implements Serializable
{
  private String type="string";
  
  private List<String> content=new ArrayList<String>();

  /**
   * <p>
   *   Constructor.
   * </p>
   */
  public ConversationObjectSerializable(){}
  
  /**
   * <p>
   *   Sets type name to include in protocol output. 
   * </p>
   * @return Type.
   */
  public ConversationObjectSerializable setType(String type)
  {
    if (type==null)
    {
      throw new NullPointerException("type");
    }
    
    this.type=type;
    return this;
  }
  
  /**
   * <p>
   *   Gets type name to include in protocol output. 
   * </p>
   * @return Type.
   */
  public String getType(){ return this.type; }
  
  /**
   * <p>
   *   Sets content retrieved.
   * </p>
   * @param content Content.
   */
  public void setContent(List<AttributeObject> content)
  {
    if (content==null)
    {
      throw new NullPointerException("content");
    }
    
    for (AttributeObject curr : content) this.content.add(curr.getName());
  }
  
  /**
   * <p>
   *   The empty array shared.
   * </p>
   */
  public static final ConversationObjectSerializable[] EMPTY_ARRAY=
    new ConversationObjectSerializable[0];
  
}
